/**
 * PasswordTable is password table.
 */
var passwordTable = {};
var key = "o:p";

function defaultCallback(err) {
	if (err) {
		console.error("groupTable redis error:" + err);
	}
}

passwordTable.setPassword = function setPassword(context, catalog,
        password, callback) {
    "use strict";
	var redis = context.redis;
	if (!callback) {
		callback = defaultCallback;
	}

    redis.hset(key, catalog, password, callback);
};

passwordTable.loadPassword = function loadPassword(context, passwordName, callback) {
    "use strict";
	var redis = context.redis;
	if (!callback) {
		callback = defaultCallback;
	}

    redis.hget(key, passwordName, callback);
};

module.exports = passwordTable;
